<template>
	<view>
		<u-navbar
		  title="投注详情"
		  title-color="#fff"
		  title-size="32"
		  :background="{
		    backgroundColor:'#CB3A35'
		  }"
		  back-icon-color="#fff"
		>
		</u-navbar>
		<view style="width: 100%;height: 40px;background: #DCDFE6;line-height: 40px;"><text style="font-size: 16px;font-weight: bold;margin-left: 10px;">竞彩足球</text><text style="float: right;margin-right: 10px;">等待开奖</text></view>
		<view style="position: relative;">
			<view style="margin:10px;">投注金额：{{info.betAmount}}元</view>
			<view style="margin:10px;">投注玩法：混合投注</view>
			<view style="margin:10px;">过关方式：{{info.betType}}</view>
			<view style="margin:10px;">投注倍数：{{info.betCnt}}注&nbsp;{{info.multiply}}倍</view>
			<view style="margin:10px;">预计奖金：{{info.minLottery}} ~ {{info.maxLottery}}</view>
			<view style="margin:10px;">投注时间：{{info.timestr}}</view>
			<view style="margin:10px;">订单编号：{{info.timeNnn}}</view>
			<view style="width: 80px;height: 80px;border: 1px solid #999;border-radius: 50%;padding-top: 24px;padding-left: 10px;position: absolute;top: 30px;right: 10px;">出票成功</view>
		</view>
		<view style="margin-top: 10px;">
				<u-table v-for="(item,index) in info.result">
					<u-tr>
						<u-th>主队vs客队</u-th>
						<u-th>赛果</u-th>
						<u-th>你的投注</u-th>
					</u-tr>
					<u-tr style="height: 50px;" v-for="(der,index) in item.result">
						<u-td style="width: 100px;">
							<span style="font-size:12px;color: #8F8F94;">{{der.matchNumStr}}&nbsp;&nbsp;</span>
							{{der.awayTeamAbbName}}vs{{der.homeTeamAbbName}}
						</u-td>
						<u-td >无</u-td>
						<u-td>
							<span style="font-size: 12px;">{{reStr(der.type)}}({{der.odds}})</span>
						</u-td>
					</u-tr>
				</u-table>
		</view>
		<view style="margin-top: 20px;">
			<u-table>
				<u-tr>
					<u-th >时间</u-th>
					<u-th>串关</u-th>
					<u-th>出票内容</u-th>
					<u-th>倍数</u-th>
					<u-th>状态</u-th>
				</u-tr>
				<u-tr :key="index" v-for="(item,index) in info.result">
					<u-td style="height: auto;">{{item.time}}</u-td>
					<u-td style="height: auto;">{{item.betType}}</u-td>
					<u-td style="height: auto;">
						<tr v-for="(ss,index) in item.result" style="width: 100px;">
							<span style="font-size: 12px;color: #8F8F94;">{{ss.matchNumStr}}</span>
							<span style="font-size: 12px;">{{reStr(ss.type)}}</span>
						</tr>
					</u-td>
					<u-td style="height: auto;">{{item.betCnt}}</u-td>
					<u-td style="height: auto;">出票成功</u-td>
				</u-tr>
			</u-table>
		</view>
	</view>
</template>


<script>
	import chuanJson from "@/data/chuan.js";
	export default {
		data() {
			return {
				info: [],
					nameData: chuanJson.data.tyna
			}
		},
		onLoad({ query }) {
			const result = JSON.parse(decodeURIComponent(query));
			this.info = result;
			// betAmount: 8
			// betCnt: 4
			// betType: "2串1"
			// maxLottery: "44.62"
			// minLottery: "9.29"
			const betAmount = ''
			this.info.timestr = this.moment(this.info.time).format("YYYY-MM-DD HH:MM:SS")
			this.info.timeNnn = this.moment(this.info.time).format("YYYYMMDDHHMMSS")
			this.info.timeSub = this.moment(this.info.time).format("MM-DD MM:SS")
			console.log('foro', this.info)
			this.info.result.forEach((item) => {
				item['betAmount']=this.info.betAmount
				item['betCnt']=this.info.betCnt
				item['betType']=this.info.betType
				item['maxLottery']=this.info.maxLottery
				item['minLottery']=this.info.minLottery
				item['time']=this.info.timeSub
			})
		},
		methods: {
			reStr (val) {
				let str = ''
				this.nameData.forEach((ii) => {
					if (val === ii.type) {
						str = ii.name
					}
				})
				return str
			},
		}
	}
</script>

<style>
</style>
